tabs = new Array('news','newsletters','commits','bugzilla');
currentTab = 0;
currentURL = document.location.href;
anchorTab = 0;
if(!Array.indexOf){
  Array.prototype.indexOf = function(obj){
   for(var i=0; i<this.length; i++){
    if(this[i]==obj){
     return i;
    }
   }
   return -1;
  }
} // Fix for IE's lack of support for indexOf
if (currentURL.search("#")){
	currentAnchor = currentURL.split('#')[1];
	if (tabs.indexOf(currentAnchor)!=-1){
		anchorTab = tabs.indexOf(currentAnchor);
		$(document).ready(function(){switchTab(anchorTab);})
	}
}

function switchTab(tab){
	if (tab!=currentTab){
	newTab = document.getElementById('tab'+tab);
	newTabContent = document.getElementById(tabs[tab]);
	oldTab = document.getElementById('tab'+currentTab);
	oldTabContent = document.getElementById(tabs[currentTab]);
	newTab.className = 'inner active';
	newTabContent.style.display = 'block';
	oldTabContent.style.display = 'none';
	oldTab.className = 'inner';
	currentTab = tab;
	}
}